Conversation
sid-rl
reviewed
Mar 25, 2026
Contributor
sid-rl
left a comment
There was a problem hiding this comment.
minor comments, looks good otherwise
sid-rl
approved these changes
Mar 25, 2026
Merged
tode-rl
added a commit
that referenced
this pull request
Apr 2, 2026
Port verification and testing from TypeScript PR #767 which fixed slow list endpoints that were auto-paginating through all pages. ## Analysis Results The Python SDK does NOT suffer from the bug that affected TypeScript because: - Python implementation uses direct property access (`page.items`) - TypeScript was using async iteration (`for await`) which auto-paginated - Our existing unit tests already used correct mocking patterns ## What Was Added New smoke tests in `tests/smoketests/sdk/test_list_pagination.py`: - 28 comprehensive tests (15 async, 13 sync) - Tests all 13 resource types (agents, devboxes, blueprints, etc.) - Verifies `list(limit=N)` returns at most N items - Ensures no auto-pagination occurs - Includes data creation test to verify with actual API calls ## Verification All SDK list methods verified correct: ✅ AsyncDevboxOps.list() - accesses page.devboxes ✅ AsyncSnapshotOps.list() - accesses page.snapshots ✅ AsyncBlueprintOps.list() - accesses page.blueprints ✅ AsyncStorageObjectOps.list() - accesses page.objects ✅ AsyncAxonOps.list() - accesses result.axons ✅ AsyncScorerOps.list() - accesses page.scorers ✅ AsyncAgentOps.list() - accesses page.agents ✅ AsyncScenarioOps.list() - accesses page.scenarios ✅ AsyncBenchmarkOps.list() - accesses page.benchmarks ✅ AsyncNetworkPolicyOps.list() - accesses page.network_policies ✅ AsyncGatewayConfigOps.list() - accesses page.gateway_configs ✅ AsyncMcpConfigOps.list() - accesses page.mcp_configs ✅ AsyncSecretOps.list() - accesses result.secrets (+ all sync equivalents) ## Benefits ✅ Faster list results - only fetches requested page ✅ Fewer API requests - no unnecessary pagination ✅ Better resource usage - respects limit parameter ✅ Documented behavior - tests serve as specification ✅ Regression prevention - ensures future changes maintain correctness ## Related - TypeScript PR: runloopai/api-client-ts#767 - Detailed analysis: PR_767_PORT_SUMMARY.md - Code comparison: IMPLEMENTATION_COMPARISON.md - Quick reference: PR_767_PORT.md ## Testing Run the new tests: ```bash uv run pytest tests/smoketests/sdk/test_list_pagination.py -v ``` No source code changes required - Python implementation already correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.